package com.sxt.springcloud.bus;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sxt.bus.domain.Provider;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sxt.bus.vo.ProviderVo;
import com.sxt.springcloud.bus.fallback.ProviderClientFallbackService;
import com.sxt.sys.common.Constast;
import com.sxt.sys.common.DataGridView;
import com.sxt.sys.common.ResultObj;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author author
 * @since 2019-12-24
 */
@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-BUS",fallbackFactory = ProviderClientFallbackService.class)
@RequestMapping("/p/provider")
public interface ProviderClientService {
    /**
     * 查询
     */
    @RequestMapping("loadAllProvider")
    DataGridView loadAllProvider(@RequestBody ProviderVo providerVo);

    /**
     * 添加
     */
    @RequestMapping("addProvider")
    ResultObj addProvider(@RequestBody ProviderVo providerVo);

    /**
     * 修改
     */
    @RequestMapping("updateProvider")
    ResultObj updateProvider(@RequestBody ProviderVo providerVo);

    /**
     * 删除
     */
    @RequestMapping("deleteProvider")
    ResultObj deleteProvider(@RequestParam("id") Integer id);

    /**
     * 批量删除
     */
    @RequestMapping("batchDeleteProvider")
    ResultObj batchDeleteProvider(@RequestBody ProviderVo providerVo);


    /**
     * 加载所有可用的供应商
     */
    @RequestMapping("loadAllProviderForSelect")
    DataGridView loadAllProviderForSelect();

}
